package com.zbkj.front.controller;

import com.zbkj.service.service.WechatCallbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 微信发货信息管理回调控制器
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: CRMEB Team <admin@crmeb.com>
 * +----------------------------------------------------------------------
 */
@Slf4j
@RestController
@RequestMapping("api/front/wechat/shipping")
@Api(tags = "微信发货信息管理回调")
public class WechatShippingCallbackController {

    @Autowired
    private WechatCallbackService wechatCallbackService;

    /**
     * 微信发货信息管理回调
     */
    @ApiOperation(value = "微信发货信息管理回调")
    @RequestMapping(value = "/callback", method = {RequestMethod.GET, RequestMethod.POST})
    public String callback(HttpServletRequest request, HttpServletResponse response) {
        log.info("接收到微信发货信息管理回调");
        return wechatCallbackService.handleShippingCallback(request, response);
    }
} 